//package com.example.tests;

import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.regex.Pattern;

public class MasterDealerCIS extends SeleneseTestCase {
	@Before
	public void setUp() throws Exception {
		selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://gofurtherwithfordnight2.com/");
		selenium.start();
	}

@Test
	public void testUntitled1() throws Exception {
		selenium.open("/idrLogin.php");
		selenium.type("id=txtSalesCode", "99999");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
		selenium.type("id=txtEmail", "thomasjohn@net.net");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
		selenium.click("link=www.americanidol.com");
		selenium.click("link=Official Rules");
		selenium.click("link=Privacy Statement");
		selenium.click("link=CA Privacy Statement");
	}
	
	@Test
	public void testUntitled2() throws Exception {
		selenium.open("/idrLogin.php");
		selenium.type("id=txtSalesCode", "99999");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
		selenium.type("id=txtEmail", "thomasjohn@net.net");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
		selenium.click("id=cbOptIn");
		selenium.click("link=Appearance Release");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
		selenium.type("id=txtEmail", "thomasjohn@net.net");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
	}
	
	@Test
	public void testUntitled3() throws Exception {
		selenium.open("/idrLogin.php");
		selenium.type("id=txtSalesCode", "99999");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
		selenium.type("id=txtEmail", "thomasjohn@net.net");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isElementPresent("css=h2"));
		verifyTrue(selenium.isTextPresent("Hello!"));
		verifyTrue(selenium.isTextPresent("John Thompson\nthomasjohn@net.net"));
		verifyTrue(selenium.isElementPresent("css=strong"));
		verifyTrue(selenium.isElementPresent("//form[@id='regForm']/div/p[2]"));
		verifyTrue(selenium.isTextPresent("exact:You have been entered for a chance to win an all-new 2013 \n Ford Fusion courtesy of Ford Credit!* Please make sure your \n information is correct."));
		verifyTrue(selenium.isTextPresent("YES! I want to tryout and test my \n judging skills with American Idol®!"));
		verifyTrue(selenium.isElementPresent("id=cbOptIn"));
		verifyTrue(selenium.isElementPresent("css=label"));
		verifyTrue(selenium.isElementPresent("link=Appearance Release"));
		verifyTrue(selenium.isTextPresent("Appearance Release"));
		verifyTrue(selenium.isTextPresent("YES! I want to tryout and test my \n judging skills with American Idol®! \n I have read and agree to the terms of the \n Appearance Release."));
		verifyTrue(selenium.isElementPresent("//form[@id='regForm']/div/p[4]"));
		verifyTrue(selenium.isTextPresent("exact:*Must be licensed driver 18 years or older, no purchase necessary, see official sweepstakes rules for complete details."));
		verifyTrue(selenium.isElementPresent("css=img"));
		verifyTrue(selenium.isElementPresent("css=a > img"));
		verifyTrue(selenium.isElementPresent("name=submit"));
		verifyTrue(selenium.isElementPresent("link=www.americanidol.com"));
		verifyTrue(selenium.isElementPresent("link=Official Rules"));
		verifyTrue(selenium.isElementPresent("link=Privacy Statement"));
		verifyTrue(selenium.isElementPresent("link=CA Privacy Statement"));
		verifyTrue(selenium.isElementPresent("id=header"));
	}
	
	@Test
	public void testUntitled4() throws Exception {
		selenium.open("/idrLogin.php");
		selenium.type("id=txtSalesCode", "99999");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
		selenium.click("css=img");
		selenium.waitForPageToLoad("30000");
		selenium.click("css=a > img");
		selenium.waitForPageToLoad("30000");
	}
	
	@Test
	public void testUntitled5() throws Exception {
		selenium.open("/idrLogin.php");
		selenium.type("id=txtSalesCode", "99999");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
		selenium.click("css=img");
		selenium.waitForPageToLoad("30000");
		selenium.click("css=a > img");
		selenium.waitForPageToLoad("30000");
		verifyTrue(selenium.isElementPresent("link=www.americanidol.com"));
		verifyTrue(selenium.isElementPresent("link=Official Rules"));
		verifyTrue(selenium.isElementPresent("link=Privacy Statement"));
		verifyTrue(selenium.isElementPresent("link=CA Privacy Statement"));
		verifyTrue(selenium.isElementPresent("//div[@id='content']/div/table/tbody/tr/td[2]/h3"));
		verifyTrue(selenium.isElementPresent("css=a > img"));
		verifyTrue(selenium.isElementPresent("css=img"));
		verifyTrue(selenium.isElementPresent("css=h3"));
		verifyTrue(selenium.isTextPresent("LOG IN WITH FACEBOOK"));
		verifyTrue(selenium.isTextPresent("LOG IN WITHOUT FACEBOOK"));
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isTextPresent("www.americanidol.com"));
		verifyTrue(selenium.isTextPresent("Official Rules"));
		verifyTrue(selenium.isTextPresent("Privacy Statement"));
		verifyTrue(selenium.isTextPresent("CA Privacy Statement"));
	}
	
	
	@Test
	public void testUntitled6() throws Exception {
		selenium.open("/idrLogin.php");
		selenium.click("link=www.americanidol.com");
		selenium.click("link=Official Rules");
		selenium.click("link=Privacy Statement");
		selenium.click("link=CA Privacy Statement");
	}
	
	
	@Test
	public void testUntitled7() throws Exception {
		selenium.open("/idrLogin.php");
		selenium.type("id=txtSalesCode", "99999");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
	}
	
	
	@Test
	public void testUntitled8() throws Exception {
		selenium.open("/idrLogin.php");
		verifyTrue(selenium.isTextPresent("Dealer Login"));
		verifyTrue(selenium.isTextPresent("Enter Sales Code:"));
		verifyTrue(selenium.isElementPresent("name=submit"));
		verifyTrue(selenium.isElementPresent("link=www.americanidol.com"));
		verifyTrue(selenium.isElementPresent("link=Official Rules"));
		verifyTrue(selenium.isElementPresent("link=Privacy Statement"));
		verifyTrue(selenium.isElementPresent("link=CA Privacy Statement"));
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isElementPresent("css=h2"));
	}
	
	@Test
	public void testUntitled9() throws Exception {
		selenium.open("/idrLogin.php");
		selenium.type("id=txtSalesCode", "99999");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
		selenium.type("id=txtEmail","thomasjohn@net.net");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
		
		}
	
	@Test
	public void testUntitled10() throws Exception {
		selenium.open("/idrLogin.php");
		selenium.type("id=txtSalesCode", "99999");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
		selenium.click("link=www.americanidol.com");
		selenium.click("link=Official Rules");
		selenium.click("link=Privacy Statement");
		selenium.click("link=CA Privacy Statement");
	}
	
	@Test
	public void testUntitled11() throws Exception {
		selenium.open("/idrLogin.php");
		selenium.type("id=txtSalesCode", "99999");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
		verifyTrue(selenium.isElementPresent("link=www.americanidol.com"));
		verifyTrue(selenium.isElementPresent("link=Official Rules"));
		verifyTrue(selenium.isElementPresent("link=Privacy Statement"));
		verifyTrue(selenium.isElementPresent("link=CA Privacy Statement"));
		verifyTrue(selenium.isElementPresent("css=h3"));
		verifyTrue(selenium.isTextPresent("I signed up online."));
		verifyTrue(selenium.isTextPresent("Welcome!"));
		verifyTrue(selenium.isElementPresent("css=h2"));
		verifyTrue(selenium.isElementPresent("//form[@id='regForm']/table/tbody/tr/td[2]/h3"));
		verifyTrue(selenium.isTextPresent("I just walked in."));
		verifyTrue(selenium.isTextPresent("Register right now by clicking \n the button below!"));
		verifyTrue(selenium.isElementPresent("css=strong"));
		verifyTrue(selenium.isElementPresent("css=img"));
		verifyTrue(selenium.isElementPresent("name=submit"));
		verifyTrue(selenium.isElementPresent("id=txtEmail"));
		verifyTrue(selenium.isTextPresent("Email Address:"));
		verifyTrue(selenium.isElementPresent("css=label"));
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isElementPresent("id=header"));
	}
	
	@Test
	public void testUntitled() throws Exception {
		selenium.open("/idrLogin.php");
		selenium.type("id=txtSalesCode", "99999");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
		selenium.click("css=img");
		selenium.waitForPageToLoad("30000");
		}
		
		
					@After
	public void tearDown() throws Exception {
		selenium.stop();
	}
}

	